package com.k2data.k2app.mapper;

import com.k2data.k2app.domain.po.RDeviceMonitorPointCopy;
import com.k2data.k2app.mybatis.mapper.K2Mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author lidong9144@163.com 17-3-15.
 */
@Mapper
@Repository
public interface RDeviceMonitorPointCopyMapper extends K2Mapper<RDeviceMonitorPointCopy> {

    RDeviceMonitorPointCopy selectLimit (@Param("id") Long id);
    RDeviceMonitorPointCopy selectLimitByLimitId (@Param("id") Long id);
    /**
     * 根据测点查询阈值规则
     *
     * @param id
     * @return
     */
    RDeviceMonitorPointCopy selectLimitByPoint (@Param("id") Long id);

    /**
     * 根据测点查询测点的默认阈值规则
     * @param id
     * @return
     */
    RDeviceMonitorPointCopy selectDefaultLimitByPoint(@Param("id") Long id,@Param("variableName") String variableName);

    Integer isExist (RDeviceMonitorPointCopy rDeviceMonitorPointCopy);
    /**
     * 查询重复记录的id最大的记录
     * @return
     */
    List<RDeviceMonitorPointCopy> selectSameOne();

    /**
     * 查询更新过阈值的测点
     *
     * <p>临时接口</p>
     * 由于之前阈值小树转换为了整数，不够精准，重新更新了一些测点阈值，查询更新过的
     * 更新完毕，无误后可以删除
     * @return
     */
    List<RDeviceMonitorPointCopy> selectDiffertPoint();

}
